import cn.sofwin.blog.dao.ArticleDao;
import cn.sofwin.blog.dao.UserDao;
import cn.sofwin.blog.entity.User;
import cn.sofwin.blog.service.UserService;
import cn.sofwin.blog.service.impl.UserServiceImpl;
import cn.sofwin.blog.utils.Dbutils;
import org.apache.ibatis.session.SqlSession;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class test2 {

    private UserDao userDao;
    private SqlSession session;

    @Before
    public void init() {
        session = Dbutils.openSession();
        userDao = session.getMapper(UserDao.class);
    }

    @After
    public void destroy() {
        session.commit();
        session.close();
    }
    @Test
    public void test2(){
        UserService userService = UserServiceImpl.getInstance();
        User register = userService.register("mazi", "123456", "lisi");
        System.out.println(register);


    }
}
